package com.example.demo.util;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.SetOperations;
import org.springframework.stereotype.Component;

@Component
public class RedisSetUtil {

	@Autowired
	private SetOperations<String, Object> setOperations;
	
	public long sadd(String key, Object ...members) {
		return setOperations.add(key, members);
	}
	
	public long scard(String key){
		return setOperations.size(key);
	}
	
	public boolean sismember(String key, Object member) {
		return setOperations.isMember(key, member);
	}
}
